using System.Collections.Generic;

public class Table_StoryGuideItem : IDataItem
{
	/// <summary>
	/// 唯一ID
	/// <summary>
	public int Id { get; private set; }
	/// <summary>
	/// 剧情对话内容ID
	/// <summary>
	public int StoryContentId { get; private set; }
	/// <summary>
	/// 剧情人物资源路径
	/// <summary>
	public string StoryRes { get; private set; }
	/// <summary>
	/// 剧情人物资源名称
	/// <summary>
	public string StoryImgName { get; private set; }
	/// <summary>
	/// 后续剧情ID
	/// <summary>
	public int NextStoryId { get; private set; }
	/// <summary>
	/// 音效ID
	/// <summary>
	public int SoundId { get; private set; }

	public Table_StoryGuideItem(ExcelLineReader reader)
	{
		Id = reader.ReadInt();
		StoryContentId = reader.ReadInt();
		StoryRes = reader.ReadString();
		StoryImgName = reader.ReadString();
		NextStoryId = reader.ReadInt();
		SoundId = reader.ReadInt();
	}
}

public class Table_StoryGuideMgr : IDataMgr
{
	protected override string FileName { get { return "Txt/StoryGuide.txt"; } }

	protected Dictionary<int, int> mItemDic = new Dictionary<int, int>();
	public int GetIdxById(int key) { return mItemDic[key]; }

	public override void Load(ExcelLineReader reader)
	{
		var item = new Table_StoryGuideItem(reader);
		mItemDic[item.Id] = DataCount;
		mItemList.Add(item);
	}

	public Table_StoryGuideItem GetItemByIdx(int idx)
	{
		return GetItemByIdx<Table_StoryGuideItem>(idx);
	}

	public Table_StoryGuideItem GetItemById(int id)
	{
		int idx = GetIdxById(id);
		return GetItemByIdx(idx);
	}
}